<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
	<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
	<meta HTTP-EQUIV="Expires" CONTENT="0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>工位管理</title>
<style type="text/css">
	@import "../dojo-release-1.5.0/dijit/themes/tundra/tundra.css";
	@import "../dojo-release-1.5.0/dojo/resources/dojo.css";
	@import "../dojo-release-1.5.0/dojox/grid/resources/tundraGrid.css";
</style>
<script type="text/javascript" src="../dojo-release-1.5.0/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
<script type="text/javascript" src="../framework/uiutil.js"></script>
<script type="text/javascript" src="../framework/simpleCRUDUtil.js"></script>
<script type="text/javascript">
var SCU = new SimpleCrudUtil({
	c:"../bkgrd/saveWorkbay.do",
	r:"../bkgrd/getAllWorkbay.do",
	d:"../bkgrd/deleteWorkbay.do",
	grid:"grid",
	idName:"workbayId"
});
dojo.addOnLoad(function(){
	SCU.R();
});

function saveWorkbay(){
	var workbayId = dojo.byId("workbayId").value;
	var description = dojo.byId("description").value;
	
	if(workbayId == ''){
		alert("请输入工位编号");
		return;
	}
	SCU.C({workbayId:workbayId,description:description});
}

//删除参数
function deleteWorkbay(){
	SCU.D();
}
</script>

<style type="text/css">
#grid{
	border:1px solid #333;
	width:95%;
	margin:10px;
	height:500px;
	font-size:0.9em;
}
</style>
</head>
<body class="tundra">

新增工位
<table width="100%">
<tr><td>工位编号</td><td><input type="text" dojoType="dijit.form.TextBox" id="workbayId" size="30" trim="true" value=""/></td></tr>
<tr><td>描述</td><td><input type="text" dojoType="dijit.form.TextBox" id="description" size="30" trim="true" value=""/></td></tr>
<tr><td colspan="2">
<button dojoType="dijit.form.Button" id="query" onclick="saveWorkbay()">保存工位</button>
<button dojoType="dijit.form.Button" id="delete" onclick="deleteWorkbay()">删除工位</button>
</td></tr>
</table>

<table dojoType="dojox.grid.DataGrid" id="grid"  autoWidth="true">
 <thead>
	<tr>
	     <th field="workbayId" width="100px">工位编号</th>
	     <th field="description" width="300px">工位描述</th>
	</tr>
</thead>
</table>
</body>
</html>